package com.yuhanginfo.modules.web.entity;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.hibernate.validator.constraints.Length;
import com.yuhanginfo.common.persistence.WebDataEntity;
import com.yuhanginfo.common.utils.StringUtils;

/**
 * 购物车Entity
 * @author lvls
 * @version 2017-10-23
 */
public class ShoppingCart extends WebDataEntity<ShoppingCart> {
	
	private static final long serialVersionUID = 1L;
	private Integer userId;			// 用户id
	private String storeCode;		// 门店号
	private String goodsCode;		// 商品号
	private Integer goodsNum;		// 商品数量
	private String status;			// 是否失效:0失效,1有效
	private String isCheck;			// 是否勾选:0未勾选 1已勾选
	private String goodsName;
	private String goodsEnName;
	private BigDecimal goodsPrice;
	private BigDecimal vipPrice;
	private String goodsImage;
	private String storeName;
	private String storeType;
	private String[] goodsCodes;
	private Integer goodsStatus;
	private Integer goodsStock;	//是否有库存 0没有 1有
	private Integer isGoodsDel;	//商品是否被删除
	private List<String> imgList;
	
	public ShoppingCart() {
		super();
	}
	
	public ShoppingCart(String id){
		super(id);
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	
	@Length(min=0, max=30, message="门店号长度必须介于 0 和 30 之间")
	public String getStoreCode() {
		return storeCode;
	}

	public void setStoreCode(String storeCode) {
		this.storeCode = storeCode;
	}
	
	@Length(min=0, max=30, message="商品号长度必须介于 0 和 30 之间")
	public String getGoodsCode() {
		return goodsCode;
	}

	public void setGoodsCode(String goodsCode) {
		this.goodsCode = goodsCode;
	}
	
	@Length(min=0, max=11, message="商品数量长度必须介于 0 和 11 之间")
	public Integer getGoodsNum() {
		return goodsNum;
	}

	public void setGoodsNum(Integer goodsNum) {
		this.goodsNum = goodsNum;
	}
	
	@Length(min=0, max=11, message="是否失效:0失效,1有效长度必须介于 0 和 11 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	public BigDecimal getGoodsPrice() {
		return goodsPrice;
	}

	public void setGoodsPrice(BigDecimal goodsPrice) {
		this.goodsPrice = goodsPrice;
	}

	public String getGoodsImage() {
		return goodsImage;
	}

	public void setGoodsImage(String goodsImage) {
		this.goodsImage = goodsImage;
	}

	public String getStoreName() {
		return storeName;
	}

	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}

	public String getStoreType() {
		return storeType;
	}

	public void setStoreType(String storeType) {
		this.storeType = storeType;
	}

	public String getIsCheck() {
		return isCheck;
	}

	public void setIsCheck(String isCheck) {
		this.isCheck = isCheck;
	}

	public String[] getGoodsCodes() {
		return goodsCodes;
	}

	public void setGoodsCodes(String[] goodsCodes) {
		this.goodsCodes = goodsCodes;
	}

	public String getGoodsEnName() {
		return goodsEnName;
	}

	public void setGoodsEnName(String goodsEnName) {
		this.goodsEnName = goodsEnName;
	}

	public BigDecimal getVipPrice() {
		return vipPrice;
	}

	public void setVipPrice(BigDecimal vipPrice) {
		this.vipPrice = vipPrice;
	}
	public List<String> getImgList() {
		if(StringUtils.isNotBlank(goodsImage)) {
			String[] im=goodsImage.split(";");
			return Arrays.asList(im);
		}else {
			this.imgList = new ArrayList<String>();
			return imgList;
		}
		
	}
	public void setImgList(List<String> imgList) {
		this.imgList = imgList;
	}

	public Integer getGoodsStatus() {
		return goodsStatus;
	}

	public void setGoodsStatus(Integer goodsStatus) {
		this.goodsStatus = goodsStatus;
	}

	public Integer getGoodsStock() {
		return goodsStock;
	}

	public void setGoodsStock(Integer goodsStock) {
		this.goodsStock = goodsStock;
	}

	public Integer getIsGoodsDel() {
		return isGoodsDel;
	}

	public void setIsGoodsDel(Integer isGoodsDel) {
		this.isGoodsDel = isGoodsDel;
	}

	
}